import axios from './axios'
export default {
    //获取列表
    getRolesList() {
        return axios.get(`roles`)
    },
    //删除权限
    deleteRoles(id, right) {
        return axios.delete(`roles/${id}/rights/${right}`)
    },
    //添加
    addRole(form) {
        return axios.post(`roles/`, form)
    },
    //修改对话框
    showRoles(id) {
        return axios.get(`roles/${id}`,)
    },
    //修改信息
    editRoles(id, form) {
        return axios.put(`roles/${id}`, form)
    },
    //删除用户
    removeRole(id) {
        return axios.delete(`roles/${id}`)
    },
    //权限弹框
    showRight(){
        return axios.get(`rights/tree`)
    },
    //分配权限
    allRight(roleId,idStr){
        return axios.post(`roles/${roleId}/rights`,idStr)
    }
}
